<template>
	<view>
		<view class="uni-form-item uni-column" v-if="!FormData">
			<view class="title">没有信息</view>
		</view>
		<view class="box" v-for="(item, index) in FormData" :key="index">
			<view class="name">客户名称: {{item.aname}}</view>
			<view class="shuangb"><text>存款金额: {{item.money}}</text><text>期限: {{item.month}}月</text></view>
			<view class="name color">剩余月份: {{item.month_sy}}</view>
		</view>
	</view>
</template>

<script>
	import DyDate from '@/components/dy-Date/dy-Date.vue'
	export default {
		components: {
			DyDate
		},
		data() {
			return {
				FormData: [],
			}
		},
		onLoad: function (option) { //option为object类型，会序列化上个页面传递的参数
			this.khid = option.id
		},
		mounted() {
			let params = {
				page: 1,
				limit: 10,
			};
			this.init(params);
		},
		methods: {
			init(params) {
				params.khId = this.khid
				this.$api.getCkT2(params).then((res) => {
					if (res.rows.length == 0) {
						this.FormData = ''
						return
					}
					this.FormData = res.rows
				}).catch((err) => {
					console.log('request fail', err);
				})
			},
		}
	}
</script>

<style scoped>
	.box {
		background: #F8F8FF;
		margin: 10px;
		border-radius: 10px;
		padding: 10px;
		line-height: 24px;
	}

	.name {
		font-weight: bold;
		font-size: 16px;
	}

	.color {
		color: red;
	}

	.shuangb {
		display: flex;
		justify-content: space-between;
	}

	.cent {
		display: flex;
		justify-content: center;
	}

	.bdfw {
		background: #007AFF;
		display: block;
		width: 100px;
		text-align: center;
		border-radius: 10px;
		color: #fff;
	}

	.time {
		display: flex;
	}

	.dateTime {
		height: 24px;
		padding: 7px 12px;
		line-height: 24px;
	}
</style>
